package ar.edu.uba.fi.jmit.monitorengine.backend.server.mock;

import java.io.IOException;
import java.util.List;

import org.apache.log4j.Logger;

import ar.edu.uba.fi.jmit.monitorengine.backend.client.JMitFileService;
import ar.edu.uba.fi.jmit.monitorengine.backend.shared.dto.JMitFileDTO;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class JMitFileServiceErrorMock extends RemoteServiceServlet implements JMitFileService {

	private static final long serialVersionUID = 1L;

	@Override
	public void deleteFile(String fileName) {
		throw new RuntimeException(fileName  + "Not found");

	}

	@Override
	public String getFileText(String fileName) throws IOException {
		throw new IOException(fileName  + "Not found");
	}

	@Override
	public List<JMitFileDTO> getLoadedConfigurationFiles() {
		Logger.getLogger(this.getClass()).debug("on getLoadedConfigurationFiles() of class JMitFileServiceErrorMock");
		throw new RuntimeException("Error");
	}

}
